<?php
namespace app\user\controller;
use app\admin\model\user\User;
use app\common\controller\Home;

class Base extends Home
{
    public function initialize()
    {
        parent::initialize();
        $user = User::where("id",_get_current_user_id())->find();
        $user['avatar'] = _get_image_preview_url($user['avatar']);

        if (!_get_current_user_id()) {
            $this->error("请先登录系统");
        }
        $this->assign([
            "user" => $user,
            "siteConfig"  => get_option('site_info'),
            "version"     => get_version(),
            "systemConfig"=> get_option("system_setting")
        ]);
    }

}